<#macro "page" pageid url >
<script language="javascript">
	function jumptopage(currentpageno,totalpagecount,pageid){
		var topnum = document.getElementById(pageid).value;
		
		if(topnum > totalpagecount){
			alert("超出了总页数，请重新输入");
			return ;
		}
		if(topnum == currentpageno){  
			return ;
		}
		//window.location="/ns/orderlist.do?curpage="+topnum;
		window.location="${url}"+topnum+"${pageparam!""}";
		
	}
</script>
<#if pagenumlist?exists&&pagenumlist??>
		<#if (currentpageno>1)>
			<a href="${url}1${pageparam!""}">首页</a>
			<a href="${url}${previouspage}${pageparam!""}">上一页</a>
		</#if>
		
		<#if pagenumlist[0]?? && pagenumlist[0]!=1><a href="javascript:void(0);">...</a></#if>
		
		<#list pagenumlist as pnum>
			<#if (currentpageno==pnum)>
				<a href="javascript:void(0);" class="page_now">${pnum}</a>
			<#else>
				<a href="${url}${pnum}${pageparam!""}">${pnum}</a>
			</#if>
		</#list>
		
		<#if pagenumlist[pagenumlist?size-1]?? && pagenumlist[pagenumlist?size-1]!=totalpagecount><a href="javascript:void(0);">...</a></#if> 
		
		<#if (currentpageno<totalpagecount)>
	    	<a href="${url}${nextpage}${pageparam!""}" class="">下一页</a>
	    	<a href="${url}${totalpagecount}${pageparam!""}">尾页</a>
		</#if>
		
		<span class="public">共${totalpagecount}页</span> 

	    <span class="public">到第 <input value="${currentpageno!""}" size="1" type="text" class="jumpToPageNum" id="pageid1"> 页  </span> 
	    <a href="javascript:" onclick="jumptopage(${currentpageno},${totalpagecount},'pageid1')">跳转</a>
</#if>		

</#macro>
